package org.example.thread;

public class MyThread2 extends Thread{
    @Override
    public void run() {
        for(int i=1;i<=100;i++){
            System.out.println(Thread.currentThread().getName()+":"+i);
            //让当前线程主动放弃掉cpu时间片
            Thread.yield();
        }
    }
}
